{% extends 'base.html' %}
{% block title %}
    学院管理
{% endblock %}
{% block header_name %}
    学院管理
{% endblock %}
{% block bread %}
  <div class="breadcrumb-holder container-fluid">
    <ul class="breadcrumb">
      <li class="breadcrumb-item"><a href="{% url 'index' %}">首页</a></li>
      <li class="breadcrumb-item active">学院管理</li>
    </ul>
    </div>
{% endblock %}
{% block body %}

    <section class="tables">
      <div class="container-fluid">
        <div class="row">
          <div class="col-lg-12">

            <div class="card">
              <div class="card-header">
                <a href="{% url 'academy_create' %}" class="btn btn-primary">添加学院</a>
              </div>
              <div class="card-body">
                <div class="table-responsive">

                  <table class="table table-striped table-hover table-bordered">
                    <thead>
                      <tr>
                        <th>序号</th>
                        <th>名称</th>
                        <th>操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      {% for academy in academies %}
                          <tr>
                          <td>{{ forloop.counter }}</td>
                          <td>{{ academy.name }}</td>
                          <td>
                            <a href="{% url 'academy_update' academy.pk %}" class="btn btn-warning btn-sm"><i class="fa fa-edit"></i>修改</a>
                            <a href="{% url 'academy_delete' academy.pk %}" class="btn btn-warning btn-danger btn-sm"><i class="fa fa-eraser"></i>删除</a>
                          </td>

                          </tr>
                      {% endfor %}
                    </tbody>
                  </table>
                </div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </section>

    {% include 'pagination.html' %}
{% endblock %}

